include(${CMAKE_SOURCE_DIR}/common.cmake)
include_directories( ${CMAKE_SOURCE_DIR}/common)
add_definitions(-DSTATIC_BUILD)
#add_definitions(-D_WINSOCK2API_)
require_boost_headers()
require_wxWidgets_headers()
require_wxWidgets_libs()
require_tinyxml_headers()
require_lua_headers()

add_subdirectory(wfbAutoGen)
include_directories(wfbAutoGen)

IF("${CMAKE_SYSTEM}" MATCHES "Linux")
	add_definitions(-D_REENTRANT)
	include_directories(/usr/include/glib-2.0)
	include_directories(/usr/lib/glib-2.0/include)
	include_directories(/usr/include/gtk-2.0)
	include_directories(/usr/lib/gtk-2.0/include )
	include_directories(/usr/include/atk-1.0 )
	include_directories(/usr/include/cairo )
	include_directories(/usr/include/pango-1.0 )
	include_directories(/usr/include/gio-unix-2.0/ )
	include_directories(/usr/include/pixman-1 )
	include_directories(/usr/include/freetype2 )
	include_directories(/usr/include/directfb )
	include_directories(/usr/include/libpng12 )
	include_directories(/usr/include/glib-2.0 )
	include_directories(/usr/lib/glib-2.0/include)
	set( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -pthread ")
	set( CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -g -pthread ")
ENDIF("${CMAKE_SYSTEM}" MATCHES "Linux")

add_executable( ttcode WIN32 MACOSX_BUNDLE 
	taotie.rc
	main.cpp
	ttcodeStateChart.cpp
	ttcodeStateChart.h
	MainFrameMgr.cpp
	MainFrameMgr.h
	MainFrameAui.cpp
	MainFrameAui.h
	ProjectNaviMgr.cpp
	ProjectNaviMgr.h
	TextEditMgr.cpp
	TextEditMgr.h
	InfoSpaceMgr.cpp
	InfoSpaceMgr.h

	NewProjectDlg.cpp
	NewProjectDlg.h

	IconImageMgr.cpp
	IconImageMgr.h
	
	TemplateMgr.h
	TemplateMgr.cpp
	ProjectDocMgr.cpp
	ProjectDocMgr.h
	
	InfoCollectMgr.cpp
	InfoCollectMgr.h

	ImportCMake.cpp
	ImportCMake.h
	
 )
if(WIN32)
target_link_libraries( ttcode common ttcodeWfbAutoGen boostLibs tinyxml Crypto liblua comctl32 Rpcrt4 wsock32 wxbase29u wxmsw29u_stc wxscintilla )
#target_link_libraries( ttcode common ttcodeWfbAutoGen boostLibs tinyxml Crypto liblua comctl32 Rpcrt4 wsock32 wxbase29ud wxscintillad wxmsw29ud_stc )
else( WIN32)
target_link_libraries( ttcode common ttcodeWfbAutoGen boostLibs tinyxml Crypto liblua wx_gtk2u-2.9 wxscintilla-2.9 gtk-x11-2.0 gdk-x11-2.0 atk-1.0 pangoft2-1.0 gdk_pixbuf-2.0 m gio-2.0 pango-1.0 freetype fontconfig gobject-2.0 gmodule-2.0 gthread-2.0 rt glib-2.0 Xinerama SM png z jpeg wxregexu-2.9 wxtiff-2.9 z dl m )
endif( WIN32)

install(TARGETS ttcode RUNTIME DESTINATION ${CMAKE_SOURCE_DIR}/Root/tt-app/bin )
